package com.zzq.mapper;

import com.zzq.Model.Article;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

public interface ArticleMapper {
    public List<Article> getAll(@Param("offset") int offset, @Param("size") int size);

    public List<Article> getAllForUnity();

    public int add(Article article);

    public int getTotal();

    public int deleteById(int articleId);

    public int edit(@Param("articleId") int articleId, @Param("title") String title, @Param("body") String body, @Param("updateTime") String updateTime);

    public int addTotalView(int articleId);

    public int addLikes(int articleId);

    public int subLikes(int articleId);

    public List<Article> getBySearchInfo(String searchInfo);

    public Article getById(int articleId);

    public List<Article> getOrderByLikes();

    public List<Article> getOrderByTotalView();

    public List<Article> getByUserId(int userId);

    public int getCountByUserId(int userId);

    public int getTotalViewByUserId(int userId);

    public int getLikesByUserId(int userId);

    public int editAvatar(@Param("articleId") int articleId, @Param("avatarPath") String avatarPath, @Param("updateTime") String updateTime);

}
